import { Navigate } from "react-router-dom";
import Home from "../views/Home";
import Index from "../views/Index";
import Shopping from "../views/shopping";
import Details from "../views/details";
import Mine from "../views/mine";
import Order from "../views/order";
const routes = [
  {
    path: "/",
    element: <Index />,
  },
  {
    path: "/home",
    element: <Home />,
  },
  {
    path: "/shopping",
    element: <Shopping />,
  },
  {
    path: "/details/:id", // 允许接收动态参数
    element: <Details />,
  },
  {
    path: "/mine",
    element: <Mine />,
  },
  {
    path: "/order",
    element: <Order />,
  },
  {
    path: "*",
    element: <Navigate to="/" replace />,
  },
];

export default routes;
